package com.shisfish.library.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;

import com.shisfish.library.Inter.IUserInter;
import com.shisfish.library.Model.User;
import com.shisfish.library.Utils.Global.GetACXmlUtils;

public class UserImpl implements IUserInter {

	private ApplicationContext ac = GetACXmlUtils.getACXml();
	IUserInter mapper = (IUserInter) ac.getBean("userMapper");
	
	@Override
	public int insertOne(User t) {
		// TODO Auto-generated method stub
		return mapper.insertOne(t);
	}

	@Override
	public int insertAll(List<User> list) {
		// TODO Auto-generated method stub
		return mapper.insertAll(list);
	}

	@Override
	public int updateOne(User t) {
		// TODO Auto-generated method stub
		return mapper.updateOne(t);
	}

	@Override
	public int updateAll(List<User> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<User> selectById(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<User> selectByKey(String key) {
		// TODO Auto-generated method stub
		return mapper.selectByKey(key);
	}

	@Override
	public List<User> selectAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int deleteOneById(int id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteAllById(List<?> ids) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteOneByKey(String key) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteAllByKey(List<?> keys) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int countAll() {
		// TODO Auto-generated method stub
		return mapper.countAll();
	}

	@Override
	public List<Map<String, Object>> selectUserLessByEmployee(String employee) {
		// TODO Auto-generated method stub
		return mapper.selectUserLessByEmployee(employee);
	}
	
	public List<User> selectByLoanid(String loanid) {
		return mapper.selectByLoanid(loanid);
	}

	@Override
	public List<User> selectByEmployee(String employee) {
		// TODO Auto-generated method stub
		return mapper.selectByEmployee(employee);
	}

	@Override
	public List<User> selectAllPage(int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectAllPage(currentPage, pageSize);
	}

	@Override
	public int countByLoanid(String loanid) {
		// TODO Auto-generated method stub
		return mapper.countByLoanid(loanid);
	}

	@Override
	public List<User> selectByLoanidPage(String loanid, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByLoanidPage(loanid, currentPage, pageSize);
	}

	@Override
	public int countBySex(int sex) {
		// TODO Auto-generated method stub
		return mapper.countBySex(sex);
	}

	@Override
	public List<User> selectBySexPage(String sex, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectBySexPage(sex, currentPage, pageSize);
	}

	@Override
	public int countByUtil(String util) {
		// TODO Auto-generated method stub
		return mapper.countByUtil(util);
	}

	@Override
	public List<User> selectByUtilPage(String util,
			int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByUtilPage(util, currentPage, pageSize);
	}

	@Override
	public int countByUsername(String username) {
		// TODO Auto-generated method stub
		return mapper.countByUsername(username);
	}

	@Override
	public List<User> selectByUsernamePage(String username, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByUsernamePage(username, currentPage, pageSize);
	}

	@Override
	public int countByUserId(String userId) {
		// TODO Auto-generated method stub
		return mapper.countByUserId(userId);
	}

	@Override
	public List<User> selectByUserIdPage(String userId, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByUserIdPage(userId, currentPage, pageSize);
	}

	@Override
	public int countByCho(String choose) {
		// TODO Auto-generated method stub
		return mapper.countByCho(choose);
	}

	@Override
	public List<User> selectByCho(String choose, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectByCho(choose, currentPage, pageSize);
	}

	@Override
	public List<User> selectByUserId(String userId) {
		// TODO Auto-generated method stub
		return mapper.selectByUserId(userId);
	}

	@Override
	public List<Map<String, Object>> selectUserId(String userId) {
		// TODO Auto-generated method stub
		return mapper.selectUserId(userId);
	}

	@Override
	public User selectByEm(String employee) {
		// TODO Auto-generated method stub
		return mapper.selectByEm(employee);
	}

	@Override
	public User selectByNP(String employee, String password) {
		// TODO Auto-generated method stub
		return mapper.selectByNP(employee, password);
	}

	@Override
	public User selectByEmail(String email) {
		// TODO Auto-generated method stub
		return mapper.selectByEmail(email);
	}

	@Override
	public int changePassword(String employee, String password) {
		// TODO Auto-generated method stub
		return mapper.changePassword(employee, password);
	}

	@Override
	public List<User> selectByLevel(int level) {
		// TODO Auto-generated method stub
		return mapper.selectByLevel(level);
	}

	public int countType(int type) {
		// TODO Auto-generated method stub
		return mapper.countType(type);
	}

	public List<User> selectTypePage(int type, int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return mapper.selectTypePage(type, currentPage, pageSize);
	}
	
	@Override
	public List<User> selectByEmployee1(String employee) {
		// TODO Auto-generated method stub
		return mapper.selectByEmployee1(employee);
	}

}
